createManageUnusedAppRestrictionsIntent
Make an Intent to redirect the user to UI to manage their unused app restriction settings for a particular app (e.g. permission revocation, app hibernation).
Note: developers must first call getUnusedAppRestrictionsStatus to make sure that unused app restriction features are available on the device before attempting to create an intent using this method. Likewise, the returned intent must be sent using startActivityForResult, _not_ startActivity.
Any return value of getUnusedAppRestrictionsStatus besides FEATURE_NOT_AVAILABLE indicates that at least one unused app restriction feature is available on the device. If the return value _is_ FEATURE_NOT_AVAILABLE, this method will throw an UnsupportedOperationException.
If the return value is ERROR, then there was an issue when fetching whether the unused app restriction features on the device are enabled for this application. However, this method will still return an intent to redirect the user.
Compatibility behavior:
- SDK 31 and above, this method generates an intent with action
Intent .ACTION_APPLICATION_DETAILS_SETTINGS
andpackageName
as data. - SDK 30, this method generates an intent with action
Intent .ACTION_AUTO_REVOKE_PERMISSIONS
andpackageName
as data. - SDK 23 through 29, this method will generate an intent with action ACTION_AUTO_REVOKE_PERMISSIONS and the package as the app with the Verifier role that can resolve the intent.
- SDK 22 and below, this method will throw an UnsupportedOperationException
Return
Returns a newly created Intent that can be used to launch an activity where users can manage unused app restrictions for a specific app.
Parameters
The Context of the calling application.
The package name of the calling application.